
package fileby.ctrl.actions.impl;

import fileby.core.ActionKey;
import fileby.model.IMagicBoxManager;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

/**
 *
 * @author Jacob
 */
class RemoveFromMagicBoxAction extends AbstractAction {

    private IMagicBoxManager magicBoxManager;

    public RemoveFromMagicBoxAction(IMagicBoxManager magicBoxManager) {
        super("Remove from Magic Box", null);
        this.magicBoxManager = magicBoxManager;
        putValue(SHORT_DESCRIPTION, "Removes selected file from Magic Box");
    }

    public void actionPerformed(ActionEvent e) {
        String path = (String)this.getValue(ActionKey.REMOVE_FROM_MAGIC_BOX.toString());
        magicBoxManager.removeFromMagicBox(path);

    }

}
